<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@page import="java.util.Date"%>
<%Date date=new Date();%>
<html>
<head>
	<title>疫苗管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript" src="${ctxScript}/bus/vaccineManage.js?<%=date.getTime()%>"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					$.ajax({
						url: "${ctx}/bus/vaccineManage/save",
						type: "post",
						data: $(form).serializeArray(),
						async : false,
						success : function(result) {
							if(result=="1"){
								layer.msg("保存成功！", {icon: 1, time: 1000}, function (){
									parent.window.location.reload();
								})
							}
							if(result=="0"){
								layer.msg("疫苗名称重复,保存失败！", {icon: 1, time: 1000}, function (){
									parent.window.location.reload();
								})
							}
						},
						error: function (e) {
							layer.msg(e, {icon: 5});
						}
					});
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
<br/>
	<form:form id="inputForm" modelAttribute="vaccineManage" action="${ctx}/bus/vaccineManage/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<%--<sys:message content="${message}"/>		--%>
            <%--<div class="control-group" style="margin-top:20px;">--%>
                <%--<label class="control-label"><span style="color:red">*</span>动物种类：</label>--%>
                <%--<div class="controls">--%>
                    <%--<form:select path="animalTypeCode" class="input-medium" maxlength="4" style="width:251px;height:30px;" >--%>
                        <%--<form:options items="${fns:getDictList('animalType')}" itemLabel="label" itemValue="value" htmlEscape="false" required="required"/>--%>
                    <%--</form:select>--%>
                <%--</div>--%>
            <%--</div>--%>
		<form:hidden path="animalTypeCode" id="animalTypeCode"/>
		<div class="control-group" >
			<label class="control-label"><span style="color:red">*</span>动物种类：</label>
			<div class="controls">
				<form:select path="dictList" class="input-largexx required" maxlength="200" id="animalType"
							 style="width:250px;height:25px;" multiple="multiple" onchange="animalTypeChange()">
					<form:options items="${list}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</div>
		</div>

        <div class="control-group">
            <label class="control-label"><span style="color:red">*</span>疫苗品种：</label>
            <div class="controls">
                <form:select path="vaccineTypeCode" class="input-medium"  maxlength="4" style="width:250px;height:30px;" >
					<form:options items="${fns:getDictList('vaccineType')}" itemLabel="label" itemValue="value" htmlEscape="false" required="required"/>
                </form:select>
            </div>
        </div>

		<div class="control-group">
			<label class="control-label"><span style="color:red">*</span>疫苗名称：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-xlarge " style="width:250px;" required="required"/>
			</div>
		</div>
	</form:form>
</body>
</html>